package cn.ivicar.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RestImpl implements ConfigIntf {
    private static transient final Logger LOGGER = LoggerFactory.getLogger(RestImpl.class);

    private String basePath;

    public RestImpl(String basepath) {
        String configpath = System.getProperty("configpath");
        if (configpath != null) {
            this.basePath = StringUtils.replace(basepath, "%configpath%", configpath);
        } else {
            LOGGER.warn("please set the configpath arg when start the tomcat server");
        }

        LOGGER.info("Config Path:" + this.basePath);
    }

    public String getBasePath() {
        return basePath;
    }

    public InputStream getResourceAsStream(String filePath) {
        // TODO Auto-generated method stub
        return null;
    }

    public Properties getResourceAsProperties(String filePath) throws IOException {
        // TODO Auto-generated method stub
        return null;
    }

    public String[] getPropertyFiles() {
        // TODO Auto-generated method stub
        return null;
    }
}
